(()=>{var t={212:(t,e,o)=>{var n=o(347);t.exports=function(t,e,o){return(e=n(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t},t.exports.__esModule=!0,t.exports.default=t.exports},319:t=>{function e(o){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(o)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},347:(t,e,o)=>{var n=o(319).default,i=o(878);t.exports=function(t){var e=i(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},878:(t,e,o)=>{var n=o(319).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,o),s.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=["wix.com","editorx.com"],e="consent-policy";function n(t){var e;const o=`[;\\s ]?${t}=([\\S]+(?:;?))`,n=document.cookie.match(o);return(null==n||null==(e=n.pop())?void 0:e.replace(";",""))||void 0}const i=t=>{s(r.CONSENT_POLICY_CHANGED,[window,document],t)};function s(t,e,o){let n;!!document.documentMode?(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!1,o)):n=new CustomEvent(t,{detail:o,bubbles:!0}),e.forEach((t=>{t&&t.dispatchEvent&&t.dispatchEvent(n)}))}const r={CONSENT_POLICY_MANAGER_READY:"consentPolicyManagerReady",CONSENT_POLICIY_INITIALIZED:"consentPolicyInitialized",CONSENT_POLICY_CHANGED:"consentPolicyChanged",CONSENT_POLICY_UPDATE_REQUESTED:"consentPolicyUpdateRequested"};var c=o(212),a=o.n(c);function l(t,e){try{"function"==typeof t&&t(e)}catch(t){console&&console.error(t)}}const u={essential:!0,functional:!0,analytics:!0,advertising:!0,dataToThirdParty:!0},y={func:"functional",anl:"analytics",adv:"advertising",dt3:"dataToThirdParty",ess:"essential"};function d(){const t=n(e);if(!t||"string"!=typeof t)return!1;let o;const i={};try{const e=JSON.parse(decodeURIComponent(t));return Object.keys(y).forEach((t=>{if("number"==typeof e[t]){i[y[t]]=1===e[t]}})),o=function(t){let e;"number"==typeof t&&(e=new Date(1e3*t*60));return e}(e.ts),{defaultPolicy:!!e.temp,policy:i,createdDate:o}}catch(t){return!1}}function f(t){return JSON.parse(JSON.stringify(t))}function p(t){const e=d();if(e)return e;return{defaultPolicy:!0,policy:f(t||u)}}class h{constructor(){a()(this,"config",{baseUrl:""}),a()(this,"hostname",window.location.hostname),a()(this,"initRan",!1),a()(this,"getValidPolicy",(t=>{const e={},{policy:o}=this.getCurrentConsentPolicy();return"object"==typeof t&&Object.keys(u).forEach((o=>{"boolean"==typeof t[o]&&(e[o]=t[o])})),{...o,...e}})),a()(this,"shouldTriggerConsentPolicyChanged",(t=>t.consentPolicy&&this.initRan&&this.getCurrentConsentPolicy().defaultPolicy&&JSON.stringify(t.consentPolicy)!==JSON.stringify(this.getCurrentConsentPolicy().policy))),a()(this,"init",(t=>{const e="string"==typeof t?{baseUrl:t}:{baseUrl:t.baseUrl,consentPolicy:t.consentPolicy};e.consentPolicy&&(e.consentPolicy=this.getValidPolicy(e.consentPolicy));const o=this.shouldTriggerConsentPolicyChanged(e);var n;this.initRan=!0,this.config={...this.config,...e},this.config.baseUrl=(n=this.config.baseUrl||"").endsWith("/")?n.slice(0,-1):n;const c=this.getCurrentConsentPolicy();(t=>{s(r.CONSENT_POLICIY_INITIALIZED,[window,document],t)})(c),o&&i(c)})),a()(this,"setConsentPolicy",((t,e,o,s)=>{if(void 0===t){const t="setConsentPolicy: no policy sent as parameter";o&&o(t),console.error(t)}const r=t=>{o&&o(`Failed setting policy. details: ${t}`)},c=JSON.stringify({policy:{...this.getValidPolicy(t),essential:!0},location:location.href,cookie:!0,...this.config.baseUrl?{baseUrl:this.config.baseUrl}:{}});!function(t,e,o,i,s){const r=new XMLHttpRequest;r.open("POST",t,!0),r.onreadystatechange=()=>{if(4===r.readyState){const t=r.status;t<200||t>=300?l(o,t):l(e,r.responseText)}},r.setRequestHeader("content-type","application/json"),s&&r.setRequestHeader("authorization",s);const c=n("XSRF-TOKEN");c&&r.setRequestHeader("x-xsrf-token",c),r.send(i||null)}("https://www.wixapis.com/privacy/v1/consent-policies",(t=>{try{const o=JSON.parse(t),n={defaultPolicy:!1,policy:o.consent.policy},s=o.consent.timestamp;s&&(n.createdDate=new Date(s)),o.consent.consentCookie&&(document.cookie=o.consent.consentCookie),i(n),e&&e(n)}catch(t){r(t)}}),r,c,s||"")})),a()(this,"getCurrentConsentPolicy",(()=>p(this.config.consentPolicy))),a()(this,"_getConsentPolicyHeader",(()=>function(t){const o=p(t).policy;let n=!1;const i=Object.keys(y).reduce(((t,e)=>{const i=o[y[e]];return t[e]=i?1:0,i||(n=!0),t}),{});return n?{[e]:encodeURIComponent(JSON.stringify(i))}:{}}(this.config.consentPolicy)))}resetPolicy(){const t=function(t){const o=d();return!(!o||o.defaultPolicy||(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=${t}; path=/;`,0))}(this.config.baseUrl||"");return t&&setTimeout((()=>{i(this.getCurrentConsentPolicy())}),5),t}publishPolicyUpdateRequestedEvent(t){void 0===t&&(t=[]),function(t){void 0===t&&(t=[]);const e=(Array.isArray(t)?t:[]).filter(((t,e,o)=>o.indexOf(t)===e)),o=0===e.length?{}:{categories:e};s(r.CONSENT_POLICY_UPDATE_REQUESTED,[window,document],o)}(t)}}if("undefined"!=typeof window){const e=new h;P=e,function(){const e={};let o;function n(){const e=window.wixEmbedsAPI;return n=t,i=o||location.hostname,!n.some((t=>{return void 0===(e=t)&&(e=""),void 0===(o=i)&&(o=""),o===e||o.endsWith(`.${e}`);var e,o}))&&e&&e.getAppToken&&e.getAppToken("22bef345-3c5b-4c18-b782-74d4085112ff");var o,n,i}["getCurrentConsentPolicy","resetPolicy","_getConsentPolicyHeader","publishPolicyUpdateRequestedEvent"].forEach((t=>{e[t]=function(){return P[t].apply(P,Array.from(arguments))}})),["initRan","hostname"].forEach((t=>{Object.defineProperty(e,t,{get:()=>P[t],set:e=>{"hostname"===t&&(P[t]=e)}})})),e.init=(t,e)=>(o=e||void 0,P.init(t)),e.setConsentPolicy=async(t,e,i)=>{let s="";if("function"==typeof o)try{s=await o()}catch(t){s=n()}else s=n();return P.setConsentPolicy(t,e,i,s)},Object.defineProperty(window,"consentPolicyManager",{value:Object.freeze(e),writable:!1,configurable:!1,enumerable:!0})}(),s(r.CONSENT_POLICY_MANAGER_READY,[window,document],window.consentPolicyManager)}var P})()})(); //# sourceMappingURL=headlessApp.bundle.min.js.map